package com.hpf.lease.web.admin.controller;

import com.hpf.lease.common.result.Result;
import com.hpf.lease.model.bean.AttrValue;
import com.hpf.lease.web.admin.service.AttrValueService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@Tag(name = "房间的属性值管理")
@RequestMapping("/admin/attr/value")
public class AttrValueController {
    @Resource
    AttrValueService attrValueService;

    @PostMapping("/saveOrUpdate")
    @Operation(summary = "对房间的属性值根据id新增或修改")
    public Result<Object> saveOrUpdate(@RequestBody AttrValue attrValue){
        return Result.build(attrValueService.saveOrUpdateInfo(attrValue));
    }
    @DeleteMapping("/deleteById")
    @Operation(summary = "根据id逻辑删除房间属性的值")
    public Result<Object> deleteById(@RequestParam Long id){
        return Result.build(attrValueService.removeById(id));
    }


}
